<div class="panel panel-success">
    <div class="panel-heading">
        <h5 class="panel-title">
            <i class="glyphicon glyphicon-folder-open"></i>&nbsp;
            <a href="/my/app/p/<%= list[0].fd_serviceid %>/key"><%= list[0].fd_name %></a>
        </h5>
    </div>
    <div class="panel-body" style="line-height: 30px;">
        <div class="form-inline">
            <div class="form-group">
                <label class="control-label">
                    Pdt ID:
                    <%= list[0].fd_serviceid %>
                </label>
            </div>
            <div class="form-group" style="margin-left:10px;">
                <label class="control-label">
                    Keys:
                    0
                </label>
            </div>
            <div class="form-group" style="margin-left:10px;">
                <label class="control-label">
                    状态:
                    <% if(list[0].fd_status == 0) { %>
                    已禁用
                    <% } else if(list[0].fd_status == 1) { %>
                    未上线
                    <% } else if(list[0].fd_status == 2) { %>
                    下线审核中
                    <% } else if(list[0].fd_status == 3) { %>
                    上线审核中
                    <% } else if(list[0].fd_status == 4) { %>
                    已上线
                    <% } %>
                </label>
            </div>
            <div class="form-group pull-right">
                <form method="post" role="form" id="action_form_delete">
                    <input id="form_action_delete" type="hidden" name="action" value="delete">
                </form>
                <a onclick="deleteapp('<%= list[0].fd_serviceid %>');" class="btn btn-danger btn-sm">
                    <i class="glyphicon glyphicon-remove"></i>
                    删除服务</a>
                </a>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    function deleteapp(serviceid) {
        BootstrapDialog.show({
            title: '提示',
            message: '请确认是否删除服务?',
            buttons: [{
                icon: 'glyphicon glyphicon-ok',
                label: '确认',
                cssClass: 'btn-success',
                action: function (dialogItself) {
                    $.post('/my/app/delete', {fd_serviceid: serviceid}, function (data) {
                        if (data.status == 0) {
                            location.href = '/my/app';
                        }
                        else{
                            BootstrapDialog.show({
                                title: '提示',
                                message: data.message
                            });
                        }
                    })
                }
            }, {
                icon: 'glyphicon glyphicon-remove',
                label: '关闭',
                cssClass: 'btn-default',
                action: function (dialogItself) {
                    dialogItself.close();
                }
            }]
        });
    }
</script>